﻿using Blog.Domain;
using Core.Repository.Where;
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Text;

namespace Blog.Application.Condition
{
   public class WhisperCondition :PageCondition
    {
        /// <summary>
        /// 账号查询
        /// </summary>
        public string Account { get; set; }
        /// <summary>
        /// 根据id查询
        /// </summary>
        public int Id { get; set; }
        /// <summary>
        /// 是否根据登录人查询
        /// </summary>
        public bool LoginUser { get; set; } = false;
        public Expression<Func<Whisper, bool>> BuildExpression()
        {
            ParseCondition<Whisper> parse = new ParseCondition<Whisper>();
            if (!string.IsNullOrEmpty(Account))
                parse.BuildExpression("Account",Account, ConditionOperation.Equal);
            return parse.BuildWhereExpression(); ;
        }

    }
}
